package org.apache.ibatis.common.logging.jarkata;

import org.apache.commons.logging.LogFactory;
import org.apache.ibatis.common.logging.Log;

/**
 * @Name JakartaCommonsLoggingImpl
 * @Description: [Jakarta commons-logging 日志框架] 实现类
 * 描述信息：该类是一个典型的对象适配器。
 * 它的内部持有一个 “org.apache.commons.logging.Log” 对象，所有方法都将操作委托了给该对象。
 * @Version v1.0.0
 * @Author: lichao
 * @Date: 2024-05-15 15:19:07
 **/
public class JakartaCommonsLoggingImpl implements Log {
    private final org.apache.commons.logging.Log log;

    public JakartaCommonsLoggingImpl(String clazz) {
        this.log = LogFactory.getLog(clazz);
    }

    @Override
    public boolean isDebugEnabled() {
        return log.isDebugEnabled();
    }

    @Override
    public boolean isTraceEnbaled() {
        return log.isTraceEnabled();
    }

    @Override
    public void error(String msg, Throwable e) {
        log.error(msg, e);
    }

    @Override
    public void error(String msg) {
        log.error(msg);
    }

    @Override
    public void warn(String msg) {
        log.warn(msg);
    }

    @Override
    public void debug(String msg) {
        log.debug(msg);
    }

    @Override
    public void trace(String msg) {
        log.trace(msg);
    }
}

